package win.demonlegion.demo

import win.demonlegion.demo.util.DatetimeUtil

fun main(args: Array<String>) {
//    println("when fun test: ${range(12)}")
    println(DatetimeUtil.get())
}

fun max(a: Int, b: Int) = if(a > b) a else b

fun describe(obj: Any): String =
    when (obj) {
        1          -> "One"
        "Hello"    -> "Greeting"
        is Long    -> "Long"
        !is String -> "Not a string"
        else       -> "Unknown"
    }

fun range(x: Int) = if (x in 1..10) "fits in range" else "not fits in range"

fun iterator() {
    val items = listOf<String>("apple", "banana", "pear")
    for(item in items) println(item)
}